C====================================================================
C Coulomb regular function  F(Z, L, Q, R)
C====================================================================
      subroutine regcul (cc, Z, L, Q, rmesh, nr, cc1)
      IMPLICIT COMPLEX*16 (A-H,O-Z)
      real*8  Z, Q, R, rmesh(nr), cc(nr), cc1(nr)
C
C     Q - momentum in atomic units
C
      do i = 1, nr
         r = rmesh(i)
         XX    = cmplx(q * r)
         ETA1  = cmplx(-z / q)
         ZLMIN = cmplx(L)
         NL    = 1
         MODE1 = 4
         KFN   = -1
         IFAIL = 1
C
         call COULCC (XX, ETA1, ZLMIN, NL, FC, GC, FCP, GCP, SIG,
     >      MODE1, KFN, IFAIL)
         if (IFAIL .ne. 0)  then
            print*, ' IFAIL =', IFAIL
            stop 'IFAIL .NE. 0'
         end if 
C
         cc(i)  = dble(real((FC)))
         cc1(i) = dble(real((FC))) / r**(L+1)
      end do 
C
      return
      end
